<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="entity.Utilisateur,manager.UserManagerRemote,javax.naming.*"%>

<%!
private UserManagerRemote manager = null;

public void jspInit(){
	try{
		InitialContext ic = new InitialContext();
		manager = (UserManagerRemote)ic.lookup("UserManagerBean/remote");
	}
	catch(Exception ex){ System.out.println("ERREUR!!" + ex.getMessage());}
	
}
	
public void jspDestroy(){
	manager=null;
	
}
%>
<%@page import="entity.Utilisateur;"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Connexion...</title>
</head>
<body>
<%
	String ulogin=request.getParameter("user_login");

	String umdp=request.getParameter("user_mdp");

	if(ulogin!="" && umdp!="")
	{
		
	
	Utilisateur u = manager.check(ulogin,umdp);
		if(u!=null){
		out.println("OK");
		out.println("login:"+ u.getLogin());
		out.println("mdp:"+ u.getMotDePasse());
		out.println("email:"+ u.getEmail());

		}
		else
		{
		out.println("Utilisateur non trouvé");
		
		}
	
	}
	else
	{
		out.println("champ saisi vide");
	}
	//out.println(manager.getInfos());
%>

</body>
</html>